<table>
	<tr>		
		<th>Nro</th>
		<th>Proveedor</th>
		<th>Fecha</th>
		<th>Servicio</th>
		<th>Cant</th>		
		<th>PU</th>		
		<th>Sub-total</th>
		<th>Total S/.</th>
		<th>Total US$</th>
		<!--th colspan="2">Acciones</th-->
	</tr>
	<% i=0
	total_soles = total_dolares = 0					
	for reserva in @archivo.reservas_confirmadas%>	
		<% j=0
		for servicio in reserva.reserva_sps%>	
			<tr class="row<%=(i%2==1?'A':'B') %>">
				<% if j==0%>				
				<td rowspan="<%= reserva.reserva_sps.size%>"><%= reserva.id%></td>
				<td rowspan="<%= reserva.reserva_sps.size%>">
					<%= h reserva.proveedor %>
				</td>
				<% end%>	
				<td><%= servicio.fecha.strftime("%m/%d")%></td>
				<td><%= servicio.servicio.nombre%></td>
				<td><%= servicio.cantidad%></td>
				<td align="right"><%= number_to_currency(servicio.precio_extranjero, {:unit=>servicio.moneda.simbolo})%></td>				
				<td align="right"><%= number_to_currency(servicio.costo, {:unit=>servicio.moneda.simbolo})%></td>
				<% if j==0%>					
					<%					
						s = (reserva.moneda.id == 1 ? reserva.total : 0)
						d = (reserva.moneda.id == 2 ? reserva.total : 0)
						total_soles += s
						total_dolares += d
					%>
					<th style="text-align:right" rowspan="<%= reserva.reserva_sps.size%>"><%= number_to_currency(s, {:unit=>""})%></th>
					<th style="text-align:right" rowspan="<%= reserva.reserva_sps.size%>"><%= number_to_currency(d, {:unit=>""})%></th>
				<% end%>	
			</tr>	
		<% j+=1
		end%>	
	<% i+=1
	end%>
	<tr>	
		<th colspan="7" style="text-align:right">Total</th>
		<th><%= number_to_currency(total_soles, {:unit=>"S/. "})%></th>
		<th><%= number_to_currency(total_dolares, {:unit=>"US$ "})%></th>
	</tr>	
</table>